<?php
class VariableHandler implements ezcWorkflowVariableHandler
{
	private $jobId;
	private $jobService;
	
	public function __construct()
	{
		$this->jobId = getenv("JOBID");
		$this->jobService = JobService::getInstance();
	}
	
	 /**
     * Load the variable $variableName that is handled by this handler.
     *
     * @param ezcWorkflowExecution $execution
     * @param string               $variableName
     */
    public function load( ezcWorkflowExecution $execution, $variableName )
    {
    	$job = $this->jobService->getJobById($this->jobId);
    	return $job['job_param'];
    }

    /**
     * Save the variable $variableName that is handled by the variable handler
     * with the value $value.
     *
     * @param ezcWorkflowExecution $execution
     * @param string               $variableName
     * @param mixed                $value
     */
    public function save( ezcWorkflowExecution $execution, $variableName, $value )
    {
    	// do nothing here!
    }
	
}